<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
use \interop\Container\ContainerInterface;

class  IndexController
{
	protected $app;

    public function __construct(ContainerInterface $ci)
    {
        $this->app = $ci;
    }

    public function index(Request $request, Response $response, $args){
    	//根据商品外部ID查询商品，如果不存在，发布商品
    	$outId = $_POST['out_id'];
    	// print_r($outId);
    	$Tmall = new TmallController;
    	$resp = $Tmall->getSku($outId);
    	// print_r($resp);
    	if($resp->skus->sku){
    		echo 0;
    	}else{
    		echo 1;
    	} 	

    }
}
